package model.preprocessor;

import java.io.BufferedWriter;
import java.io.IOException;

import controller.preprocessor.ReViVal;
import controller.xml.XMLBaliseFormat;

/**
 * Class for managing of {@link ReViVal} parameter.
 * 
 * @author GRONOWSKI Stephane svan001@aol.com
 * 
 *         igsat 2010
 * 
 */
public class RevivalParameter extends PreProcessorParameter {

	/**
	 * Create a new revival parameter.
	 * 
	 * @param out
	 *            the output file.
	 */
	public RevivalParameter(String out) {
		super(out);
	}


	/**
	 * Create a new revival parameter.
	 */
	public RevivalParameter() {
	}

	/**
	 * Create a new revival parameter based on a {@link PreProcessorParameter}.
	 * 
	 * @param param
	 *            a {@link PreProcessorParameter}
	 */
	public RevivalParameter(PreProcessorParameter param) {
		timeOut = param.getTimeOut();
		out = param.getOut();
	}

	/**
	 * Export the data in XML
	 * 
	 * @param file
	 *            {@link BufferedWriter} to write
	 * @throws IOException
	 */
	@Override
	public void exportXML(BufferedWriter file) throws IOException {
		// open
		// file.newLine();
		file.write("<" + XMLBaliseFormat.PARAMETER + " " + XMLBaliseFormat.TYPE_PARAMETER + "=" + "\""
				+ XMLBaliseFormat.TYPE_PARAMETER_PREPROCESSOR + "\"" + " >");

		// preproc param
		super.exportXML(file);

		// close
		// file.newLine();
		file.write("</" + XMLBaliseFormat.PARAMETER + ">");
	}

}
